package cn.llk.mall.service;

import cn.llk.mall.entity.UserEntity;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author llk
 * @since 2021-04-20
 */
public interface UserService extends IService<UserEntity> {


    /**
     * 根据 username 返回 user
     *
     * @param userName 用户名
     * @return {@link UserEntity}
     */
    default UserEntity getByName(String userName) {
        return getBaseMapper().selectOne(new QueryWrapper<UserEntity>().eq("user_name", userName));
    }
}
